
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <title>留言板</title>
    <link rel="stylesheet" type="text/css" href="css/base.css" />
    <style>
        div.clearfix:hover{
            color: #c81623;
            background-color: lightgreen;
        }
        div.clearfix{ border: 1px solid lightgrey;}
        body{text-align:center}
    </style>
</head>
<body>
<h1 align="center"> 留言板列表 </h1>

<p align="center">遍历List集合的全部元素：</p>
<br>
<div class="w">
    <div class="ar">
        <a href="${basePath}message/add.jsp">添加</a>
    </div>
    <c:forEach items="${requestScope.messageList}" var="message" varStatus="id">
        <div class="clearfix">
            <div class="title fl">${message.title}</div>
            <div class="pushTime fr">${message.pushTime}</div>
        </div>
        <div class="clearfix">
            <div class="content al">${message.content}</div>
        </div>
        <div class="clearfix ar">
            <a class="ar" href="${basePath}commentList?mid=${message.id}">查看</a>||
            <%-- <a class="ar">评论数量${message.commentList.size()}</a> --%>
        </div>
    </c:forEach>
</div>
</body>
</html>
